@file:Suppress("NOTHING_TO_INLINE")
package com.hzw.core.thread

import android.os.Looper

@JvmField
val mainLooper: Looper = Looper.getMainLooper()!!
@JvmField
val mainThread: Thread = mainLooper.thread

val isMainThread inline get() = mainThread === Thread.currentThread()

inline fun checkMainThread() = check(isMainThread) {
    "应在主线程上调用它！当前线程: ${Thread.currentThread()}"
}

inline fun checkNotMainThread() = check(!isMainThread) {
    "永远不要在主线程上调用它！当前线程: ${Thread.currentThread()}"
}


